// 注册
import request from "../utils/request";

// 查询文章分类
export const articleCategoryAPI = () => {
    return request.get('/category')
}

// 新增文章分类
export const addArticleCategoryAPI = (params) => {
    return request.post('/category', params)
}

// 修改文章分类
export const updateArticleCategoryAPI = (params) => {
    return request.put('/category', params)
}

// 删除文章分类
export const deleteArticleCategoryAPI = (id) => {
    return request.delete(`/category?id=${id}`)
}

// 查询文章列表
export const articleAPI = (params) => {
    return request.get('/article', {params: params})
}

// 发布文章
export const addArticleAPI = (params) => {
    return request.post('/article', params)
}

// 修改文章
export const updateArticleAPI = (params) => {
    return request.put('/article', params)
}

// 删除文章
export const deleteArticleAPI = (id) => {
    return request.delete(`/article?id=${id}`)
}